<html>
	<head>
		<title>Create Collection</title>
		<link rel="stylesheet" href="${rc.getContextPath()}/resources/css/styles.css" type="text/css"></link>
	</head>
	<body>
		<script src="${rc.getContextPath()}/resources/js/uploadCollection.js"></script>
		<@macro.logoutForm />
		<h3>Upload Collection</h3>		
		<label class="error">${uploadError}</label>
		<form enctype="multipart/form-data" method="post" action="${rc.getContextUrl('/collection/uploadCollection')}">
			<div>
	    		<label for="collection">Collection (.zip)</label>
	    		<input type="file" name="collectionFile"/>
	    	</div>
	    	<div>
		    	<label for="image">Image (.jpg, .png)</label>
		    	<input type="file" name="imageFile"/>
	    	</div>
	   		<input class="StyleBtn" type="submit" value="Upload"/>
		</form>
		
		<label class="error">${deleteError}</label>
		<table>
   			<thead>
   				<tr>
   					<th></th>
   					<th>Collection Name</th>
   					<th>Author</th>
   					<th>Description</th>
   					<th>Last Updated</th>
   					<th></th>
   					<th></th>
   				</tr>
   			</thead>
   			<tbody>
   				<#list collections as coll>
   				<tr>	   			
   					<td><image width="40" height="40" src="${rc.getContextUrl('/collection/getIconImage?id=')+coll.id}"></image></td>		   				
   					<td>${coll.name}</td>
   					<td>${coll.author}</td>
   					<td>${coll.description}</td>
   					<td>${coll.lastUpdate}</td>
   					<td><a href="${rc.getContextUrl('/collection/getPackage?id=') + coll.id}" >Download</a></td>
   					<td><a onclick="return confirm('Are you sure you want to delete this collection?')" href="${rc.getContextUrl('/collection/deleteCollection?id=') + coll.id}" >Delete</a></td>
   				</tr>
   				</#list>
   			</tbody>
   		</table>
	</body>
</html>